﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;

using Xc.DataAccess.DataBase.DeviceInfos.Models;

namespace Xc.WaterMeters.ServerHosts.Models
{
    public class ApplicationDbContext:DbContext,IDbDevice
    {
        /// <summary>
        /// <para>
        /// Initializes a new instance of the <see cref="ApplicationDbContext" /> class. The
        /// <see cref="M:Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder)" />
        /// method will be called to configure the database (and other options) to be used for this context.
        /// </para>
        /// </summary>
        protected ApplicationDbContext()
        {

        }

        /// <summary>
        /// <para>
        /// Initializes a new instance of the <see cref="ApplicationDbContext" /> class using the specified options.
        /// The <see cref="M:Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder)" /> method will still be called to allow further
        /// configuration of the options.
        /// </para>
        /// </summary>
        /// <param name="options">The options for this context.</param>
        public ApplicationDbContext(DbContextOptions options) : base(options)
        {

        }

        /// <summary>
        /// 设备信息
        /// </summary>
        public DbSet<DeviceInfo> DeviceInfos { get; set; }
        /// <summary>
        /// 属性信息
        /// </summary>
        public DbSet<DevicePropertyInfo> DevicePropertyInfos { get; set; }
        /// <summary>
        /// 报警信息
        /// </summary>
        public DbSet<AlarmInfo> AlarmInfos { get; set; }
        /// <summary>
        /// 命令信息
        /// </summary>
        public DbSet<CommandInfo> CommandInfos { get; set; }
        /// <summary>
        /// 报警信息历史
        /// </summary>
        public DbSet<AlarmInfoHistory> AlarmInfoHistorys { get; set; }
        /// <summary>
        /// 属性信息历史表
        /// </summary>
        public DbSet<DevicePropertyInfoHistory> DevicePropertyInfoHistorys { get; set; }
        /// <summary>
        /// 设备信息历史数据
        /// </summary>
        public DbSet<DeviceInfoHostory> DeviceInfoHistorys { get; set; }
    }
}
